From c9e848b659e591c001b87eb8effa845c2bce7ffd Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 18 Jun 2014 18:21:51 -0400 Subject: [PATCH] GtkIconTheme: Fix svg loading with FORCE_SIZE Paradoxically, we were loading svgs at the nominal size when FORCE_SIZE is specified, while scaling them exactly when it isn't. ../build/win32/vs10/gtk.vcxproj --- gtk/gtkicontheme.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 8b6dca33de..aca62c146f 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1766,9 +1766,10 @@ real_choose_icon (GtkIconTheme *icon_theme, icon_info->desired_scale = scale; icon_info->forced_size = (flags & GTK_ICON_LOOKUP_FORCE_SIZE) != 0; - /* In case we're not scaling the icon we want to reuse the exact same size - * as a scale==1 lookup would be, rather than not scaling at all and - * causing a different layout */ + /* In case we're not scaling the icon we want to reuse the exact same + * size as a scale==1 lookup would be, rather than not scaling at all + * and causing a different layout + */ icon_info->unscaled_scale = 1.0; if (scale != 1 && !icon_info->forced_size && theme != NULL) { @@ -3922,7 +3923,12 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info, { if (icon_info->is_svg) { - gint size = icon_info->dir_size * icon_info->dir_scale * icon_info->scale; + gint size; + + if (icon_info->forced_size) + size = scaled_desired_size; + else + size = icon_info->dir_size * icon_info->dir_scale * icon_info->scale; source_pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream, size, size, -- 2.30.2